#ifndef __LCD1602_H__
#define __LCD1602_H__

#include "stm32f10x.h"                  // Device header
#include "Delay.h"

//使用结构体
typedef struct{
	uint8_t com;
	uint8_t num;
	uint8_t *data;
}LCD_InitTypeDef;


#define RS	GPIO_Pin_0	//RS = 0,指令；RS = 1,数据
#define RW	GPIO_Pin_1	//RW = 0,写  ；RW = 1,读
#define EN	GPIO_Pin_2
#define CMD_PROT 	GPIOC

#define DATA 0x00FF	//0~7引脚
#define DATA_PROT	GPIOF

#define RS_HIGH GPIO_SetBits  (CMD_PROT, RS)
#define RS_LOW  GPIO_ResetBits(CMD_PROT, RS)

#define RW_HIGH GPIO_SetBits  (CMD_PROT, RW)
#define RW_LOW  GPIO_ResetBits(CMD_PROT, RW)

#define EN_HIGH GPIO_SetBits  (CMD_PROT, EN)
#define EN_LOW  GPIO_ResetBits(CMD_PROT, EN)

#define CMD 0	//代表RS = 0，指令
#define DAT 1	//代表RS = 1，数据

void LCD1602_UserInit(void);	//LCD1602初始化
void LCD1602_Write_Init(void);	//LCD1602写初始化
void LCD1602_Open(void);
void LCD1602_Shut(void);

void LCD1602_Write_Word_Display(LCD_InitTypeDef  LCD_InitStructure);

void LCD1602_Number_Display(u8 com, u8 num);

#endif
